home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / CSMP Digests / csmp-v1-043.txt < prev    next >
Encoding:
Text File  |  1992-11-18  |  41.5 KB  |  1,164 lines  |  [TEXT/MPS ]

  1. C.S.M.P. Digest             Tue, 07 Apr 92       Volume 1 : Issue 43
  2.  
  3. Today's Topics:
  4.  
  5.     Copybits ATE my colors!
  6.      MPW Shell 3.2.2
  7.     C++ code : Translation of MacApp sample program Calc
  8.     MPW C package missing files?
  9.     (Q) Mixing PlaySnd and MacInTalk
  10.     Graf3D
  11.     Prototyper v.3.0
  12.     Zoom Rect. Code Needed
  13.     Question on allocating memory for array??
  14.     Writing a WDEF that uses the default WDEF?
  15.     Random Numbers (Toolbox Built-in)
  16.  
  17.  
  18. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  19.  
  20. These digests are available (by using FTP, account anonymous, your email
  21. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  22. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  23. Questions list.
  24.  
  25. These digests are also available via email.  Just send a note saying that you
  26. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  27. automatically receive each new digest as it is created.
  28.  
  29. The articles in these digests are taken directly from comp.sys.mac.programmer.
  30. They are not edited; all articles included in this digest are in their original
  31. posted form.  The only articles that are -not- included in these digests are
  32. those which didn't receive any replies (except those that give information
  33. rather than ask a question).  All replies to each article are concatenated
  34. onto the original article in the order in which they were received.  Article
  35. threads are not added to the digests until the last article added to the
  36. thread is at least one month old (this is to ensure that the thread is dead
  37. before adding it to the digests).
  38.  
  39. Send administrative mail to mkelly@cs.uoregon.edu.
  40.  
  41. -------------------------------------------------------
  42.  
  43. From: busey@milton.u.washington.edu (Thomas Busey)
  44. Subject: Copybits ATE my colors!
  45. Organization: University of Washington
  46. Date: Thu, 27 Feb 1992 18:20:56 GMT
  47.  
  48. We are using offscreen gworlds to do offscreen pixmaps.  We are
  49. fairly sure we are setting up the gworlds properly, setting bit 14,
  50. setting the palette colors to explicit and animated, and setting
  51. up the cluts properly.
  52.  
  53. As a test, we tried to copybits the main screen ONTO ITSELF:
  54.  
  55. copyBits(myWindow^.portBits, myWindow^.portBits,
  56.                      destRect, destRect, srcCopy, NIL);    
  57.  
  58. This had the net effect of changing all of the nice, pretty colors on the
  59. screen into either the foreground or background colors.
  60.  
  61. What are we doing wrong?  Do we need to handle inverse tables somehow? 
  62.  
  63. Eventually we want the ability to copy the offscreen image onto the screen,
  64. but do this in such a way that the current clut is all background colors.
  65. Then we can switch in the foreground clut and make the image appear all at once.
  66.  
  67. Is this possible?  Why isn't our copybits working properly?
  68.  
  69. Thanks,
  70.  
  71. Tom Busey
  72. University of Washington
  73. Seattle, WA
  74. busey@u.washington.edu
  75.  
  76.  
  77.  
  78.  
  79. - -------------------------
  80.  
  81. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  82. Date: 5 Mar 92 16:07:09 GMT
  83. Organization: MacDTS, Apple Computer
  84.  
  85. In article <busey.699214856@milton>, busey@milton.u.washington.edu (Thomas Busey) writes:
  86. > We are using offscreen gworlds to do offscreen pixmaps.  We are
  87. > fairly sure we are setting up the gworlds properly, setting bit 14,
  88. > setting the palette colors to explicit and animated, and setting
  89. > up the cluts properly.
  90. > As a test, we tried to copybits the main screen ONTO ITSELF:
  91. > copyBits(myWindow^.portBits, myWindow^.portBits,
  92. >                      destRect, destRect, srcCopy, NIL);    
  93. > This had the net effect of changing all of the nice, pretty colors on the
  94. > screen into either the foreground or background colors.
  95. > What are we doing wrong?  Do we need to handle inverse tables somehow? 
  96. > Eventually we want the ability to copy the offscreen image onto the screen,
  97. > but do this in such a way that the current clut is all background colors.
  98. > Then we can switch in the foreground clut and make the image appear all at once.
  99. > Is this possible?  Why isn't our copybits working properly?
  100.  
  101. You're copying from a GDevice (the main screen) that doesn't have bit 14 set.
  102. Therefore, QuickDraw will attempt to do plain old color matching for the colors.
  103. However, you've used most of the colors as animating colors, and QuickDraw won't
  104. use those entries to match the colors it wants, so everything ends up mapping
  105. to a limited set of colors (usually black and white).  It sounds like you're
  106. doing everything right so far; CopyBits is working properly.  If you were to
  107. copy from the offscreen, everything would work fine, because it has bit 14 set,
  108. so it will do palette mapping.
  109.  
  110. Tim Dierks
  111. MacDTS, but I speak for myself
  112.  
  113. ---------------------------
  114.  
  115. From: jess@gn.ecn.purdue.edu (Jess M Holle)
  116. Subject:  MPW Shell 3.2.2
  117. Date: 27 Feb 92 19:06:29 GMT
  118. Organization: Purdue University Engineering Computer Network
  119.  
  120. I've posted this once with no response, so I'm trying again.
  121.  
  122. I recently noticed MPW Shell 3.2.2 on ftp.apple.com.  I own MPW 3.2,
  123. so I would like to know what are the differences between MPW Shell
  124. 3.2 and 3.2.2 (i.e. bug fixes, new features, etc).
  125.  
  126. Thanks to any and all who reply.
  127.  
  128. Jess Holle
  129.  
  130.  
  131.  
  132. - -------------------------
  133.  
  134. From: ksand@apple.com (Kent Sandvik)
  135. Date: 6 Mar 92 16:54:13 GMT
  136. Organization: MacDTS Mongols
  137.  
  138. In article <1992Mar1.013143.12390@dartvax.dartmouth.edu>,
  139. Joe.Francis@dartmouth.edu (Joe Francis) writes:
  140. > In article <1992Feb27.190629.13152@gn.ecn.purdue.edu>
  141. > jess@gn.ecn.purdue.edu (Jess M Holle) writes:
  142. > > I recently noticed MPW Shell 3.2.2 on ftp.apple.com.  I own MPW 3.2,
  143. > > so I would like to know what are the differences between MPW Shell
  144. > > 3.2 and 3.2.2 (i.e. bug fixes, new features, etc).
  145.  
  146. > Here is my NON_APPLE_EMPLOYEE TOTAL GUESS (tm).  ETO #6 had a botched
  147. > MPW 3.2.1 shell on it.  My guess is 3.2.2 is a correction that has been
  148. > placed on ftp.apple.com to enable us ETO hosers to get the 3.2.1
  149. > functionality without the 3.2.1 disfunctionality.  I just use the
  150. > experimental Shell - I've never had more than cosmetic bugs with them
  151. > and I use the new features (in fact, I pretty much find things like
  152. > "ObsoleteProjectFile" neccessary for sanity preservation).
  153.  
  154. This is more than a guess :-). MPW 3.2.1 had a problem in combination with
  155. Projector. If you are bitten by this combination, roll back to MPW 3.2, or 
  156. download 3.2.2 from AppleLink or ftp.apple.com. Or wait for ETO#7 which 
  157. should be out within two weeks.
  158.  
  159. Cheers,
  160. Kent
  161.  
  162. - --
  163. Kent Sandvik - Apple DTS  - Dynamic Language Evangelist
  164. ksand@apple.com
  165. All opinions expressed are my own, and not related to any company or
  166. organization.           Have fun!
  167.  
  168. ---------------------------
  169.  
  170. From: pthomas@magnus.acs.ohio-state.edu (Pavithran D Thomas)
  171. Subject: C++ code : Translation of MacApp sample program Calc
  172. Organization: The Ohio State University
  173. Date: Thu, 27 Feb 1992 23:26:06 GMT
  174.  
  175. I'm a graduate student with fair-to-extensive programming experience on
  176. the Mac.  However, I'm just beginning to work with MacApp and C++.  I
  177. need to implement a simple spreadsheet within a larger application which
  178. I am writing in C++.  I went through the sample spreadsheet code (Calc) which
  179. comes as an example with MacApp 2.0, and realize that this would be very
  180. helpful in my quest.  I'm wondering, however, if a version of Calc exists
  181. in C++, and if so, would a kind soul with knowledge of such a creature
  182. help me obtain a copy that I could learn and adapt from?  
  183.  
  184. Thanks!
  185.  
  186. -pavi-
  187. _____________________________________________________________________________
  188. Pavithran D. Thomas                            pavi@rcgl1.eng.ohio-state.edu
  189. Graduate Student / Systems Programmer       pthomas@magnus.acs.ohio-state.edu
  190.         Dept. of Mechanical Engineering, The Ohio State University
  191.  
  192.  
  193. -- 
  194. _____________________________________________________________________________
  195. Pavithran D. Thomas                                       pavi@rcgl1.eng.ohio-state.edu
  196. Graduate Student / Systems Programmer       pthomas@magnus.acs.ohio-state.edu
  197.         Dept. of Mechanical Engineering, The Ohio State University
  198.  
  199.  
  200.  
  201. - -------------------------
  202.  
  203. From: ksand@apple.com (Kent Sandvik)
  204. Date: 5 Mar 92 20:36:29 GMT
  205. Organization: MacDTS Mongols
  206.  
  207. In article <1992Feb27.232606.21677@magnus.acs.ohio-state.edu>, pthomas@magnus.acs.ohio-state.edu (Pavithran D Thomas) writes:
  208. > I'm a graduate student with fair-to-extensive programming experience on
  209. > the Mac.  However, I'm just beginning to work with MacApp and C++.  I
  210. > need to implement a simple spreadsheet within a larger application which
  211. > I am writing in C++.  I went through the sample spreadsheet code (Calc) which
  212. > comes as an example with MacApp 2.0, and realize that this would be very
  213. > helpful in my quest.  I'm wondering, however, if a version of Calc exists
  214. > in C++, and if so, would a kind soul with knowledge of such a creature
  215. > help me obtain a copy that I could learn and adapt from?  
  216.  
  217. MacApp 3.0 has Calc rewritten in C++ - so yuo don't need to do the job.
  218.  
  219. Cheers,
  220. Kent Sandvik/DTS
  221.  
  222. ---------------------------
  223.  
  224. From: 6500dby@ucsbuxa.ucsb.edu (Bruce Young)
  225. Subject: MPW C package missing files?
  226. Date: 27 Feb 92 23:28:41 GMT
  227.  
  228. I am posting this question for a friend who doesn't have
  229. access to news. If it has been discussed, I apologize, but
  230. I don't normally read comp.sys.mac.programmer. Here is
  231. his question:
  232.     I recently purchased the MPW C v3.2 compiler, and
  233. the new system toolbox and interfaces was missing the files
  234. CInterface.O and CRuntime.O, which the manual says should
  235. be there. Without these files, I cannot successfully link a
  236. C application because the compiler expects them to be there.
  237. I have talked to APDA and have been unsuccessful in finding
  238. anyone with a technical background. They have been completely
  239. unsympathetic, and offer no solution or explanation to the
  240. missing files problem. Does anyone what is going on with this?
  241.  
  242. If anyone knows the name of someone at apple or APDA who could
  243. get these files to Scott, or whether the package can be made
  244. to work without them, or even if someone could email the files
  245. to me, so I could download them and pass them on, it would be
  246. greatly appreciated.
  247.  
  248. Thanks,
  249. Bruce
  250.  
  251. 6500dby@ucsbuxa.ucsb.edu
  252.  
  253.  
  254.  
  255. - -------------------------
  256.  
  257. From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher)
  258. Subject:  MPW C package missing files?
  259. Organization: Integrated Systems Laboratory, ETH, Zurich
  260. Date: 28 Feb 92 09:55:16
  261.  
  262. In article <3573@ucsbcsl.ucsb.edu> 6500dby@ucsbuxa.ucsb.edu (Bruce Young) writes:
  263. >I am posting this question for a friend who doesn't have
  264. >access to news. If it has been discussed, I apologize, but
  265. >I don't normally read comp.sys.mac.programmer. Here is
  266. >his question:
  267. >    I recently purchased the MPW C v3.2 compiler, and
  268. >the new system toolbox and interfaces was missing the files
  269. >CInterface.O and CRuntime.O, which the manual says should
  270. >be there. Without these files, I cannot successfully link a
  271. >C application because the compiler expects them to be there.
  272.  
  273. Actually, the *Linker* expects them to be there, since the *Makefile* told him
  274. so, and the Makefile is wrong :-). Beginning with MPW 3.2, these two files are
  275. not needed anymore (In fact it is harmful to take old versions and link them
  276. in. So, just remove the two files and link with Interface.o and Runtime.o
  277. instead.
  278.  
  279. >I have talked to APDA and have been unsuccessful in finding
  280. >anyone with a technical background.
  281.  
  282. Grrrrrrrrrrrr. Can I quote you on that ?
  283.  
  284. Matthias
  285.  
  286. - ---
  287. Matthias Neeracher                                   neeri@iis.ethz.ch
  288.  "I have talked to APDA and have been unsuccessful in finding
  289.   anyone with a technical background." -- Bruce Young
  290.  
  291.  
  292.  
  293. - -------------------------
  294.  
  295. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  296. Date: 3 Mar 92 23:29:23 GMT
  297. Organization: MacDTS, Apple Computer
  298.  
  299. In article <3573@ucsbcsl.ucsb.edu>, 6500dby@ucsbuxa.ucsb.edu (Bruce Young) writes:
  300. >     I recently purchased the MPW C v3.2 compiler, and
  301. > the new system toolbox and interfaces was missing the files
  302. > CInterface.O and CRuntime.O, which the manual says should
  303. > be there. Without these files, I cannot successfully link a
  304. > C application because the compiler expects them to be there.
  305. > I have talked to APDA and have been unsuccessful in finding
  306. > anyone with a technical background. They have been completely
  307. > unsympathetic, and offer no solution or explanation to the
  308. > missing files problem. Does anyone what is going on with this?
  309.  
  310. If you'll examine the release notes, you'll find that CRuntime.o and
  311. CInterface.o have been removed from the 3.2 release; all their routines
  312. are now contained within Runtime.o and Interface.o.  Edit your make files
  313. to use the generic libraries:
  314.  
  315. change all occurances of {CLibraries}CRuntime.o   to {Libraries}Runtime.o
  316.    "    "      "       " {CLibraries}CInterface.o to {Libraries}Interface.o
  317.  
  318. then delete any duplicates on your link line (specifically, you'll probably
  319. now have two references to Interface.o).
  320.  
  321. Enjoy,
  322. Tim Dierks
  323. MacDTS, but I speak for myself
  324.  
  325. ---------------------------
  326.  
  327. From: gsager@heliacal.Eng.Sun.COM (Gary Sager)
  328. Subject: (Q) Mixing PlaySnd and MacInTalk
  329. Date: 28 Feb 92 16:37:20 GMT
  330. Organization: Sun Microsystems
  331.  
  332.  
  333. I have a program that works fine doing just PlaySnd, or just MacInTalk, but if I
  334. mix the two, the program bombs (have to power off the machine!) apparently some-
  335. where in PlaySnd.  This is true even if it has been some time since the last call
  336. to MacInTalk, and if I have called SoundOff to shut off the MacInTalk driver.
  337. I have looked at all the related pointers and data at initialization and at call
  338. time, and nothing seems to be getting scrambled.
  339.  
  340. This is on a IIsi.
  341.  
  342. Does anyone have a clue why this might be happening (beyond the ever-possible
  343. obscure bug I might have)?  I have heard that there is some problem with sound
  344. on the IIsi, where sound gets disabled, but this seems much more extreme.
  345.  
  346.  
  347.  
  348. - -------------------------
  349.  
  350. From: omh@cs.brown.edu (Owen M. Hartnett)
  351. Subject:  (A) Mixing PlaySnd and MacInTalk
  352. Date: 1 Mar 92 06:53:33 GMT
  353. Organization: Brown University Department of Computer Science
  354.  
  355. In article <kqspa0INNfaq@exodus.Eng.Sun.COM> gsager@heliacal.Eng.Sun.COM writes:
  356. >
  357. >I have a program that works fine doing just PlaySnd, or just MacInTalk, but if I
  358. >mix the two, the program bombs (have to power off the machine!) apparently some-
  359. >where in PlaySnd.  This is true even if it has been some time since the last call
  360. >to MacInTalk, and if I have called SoundOff to shut off the MacInTalk driver.
  361. >I have looked at all the related pointers and data at initialization and at call
  362. >time, and nothing seems to be getting scrambled.
  363.  
  364. Try closing the sound driver, then opening it again, when you switch modes.
  365. Use the CloseDriver, OpenDriver calls, Inside Mac II-178 or so.  Inside Mac
  366. says you probably will never have to close the sound driver, but this time
  367. you do!
  368.  
  369. Remember that Macintalk is using the old sound driver, not the new one, so
  370. you'll have to use the old calls to close it.
  371.  
  372. -Owen
  373.  
  374. Owen Hartnett                omh@cs.brown.edu
  375. "FAITH, n. Belief without evidence in what is told by one who speaks
  376.         without knowledge, of things without parallel."
  377.             -Ambrose Bierce - The Devil's Dictionary
  378.  
  379.  
  380.  
  381. - -------------------------
  382.  
  383. From: sasdtm@stthomas.unx.sas.com (Donald T. Major)
  384. Subject:  (Q) Mixing PlaySnd and MacInTalk
  385. Organization: SAS Institute Inc.
  386. Date: Mon, 2 Mar 1992 19:30:23 GMT
  387.  
  388. In article <kqspa0INNfaq@exodus.Eng.Sun.COM>, gsager@heliacal.Eng.Sun.COM (Gary Sager) writes:
  389. |>
  390. |> I have a program that works fine doing just PlaySnd, or just MacInTalk, but if I
  391. |> mix the two, the program bombs (have to power off the machine!) apparently some-
  392. |> where in PlaySnd.  This is true even if it has been some time since the last call
  393. |> to MacInTalk, and if I have called SoundOff to shut off the MacInTalk driver.
  394. |> I have looked at all the related pointers and data at initialization and at call
  395. |> time, and nothing seems to be getting scrambled.
  396. |>
  397. |> This is on a IIsi.
  398. |>
  399. |> Does anyone have a clue why this might be happening (beyond the ever-possible
  400. |> obscure bug I might have)?  I have heard that there is some problem with sound
  401. |> on the IIsi, where sound gets disabled, but this seems much more extreme.
  402.  
  403. The reason is because PlaySnd is a Sound Manager routine (and therefore
  404. compatible with it) while MacinTalk is a pre-Sound Manager system
  405. extension, for which Apple has only the code, not the source, and which
  406. is NOT Sound Manager compatible.  You can't mix and match the two,
  407. because while Apple managed to make the system support pre-Sound Manager
  408. code, they did so at the expense of using the Sound Manager thereafter,
  409. or such is my understanding.  At any rate, it's not really a bug, but
  410. a failure on your part to pay attention to Apple's disclaimer about
  411. MacinTalk--use at your own risk.
  412.  
  413.                                              ..
  414.                                             dtm
  415.  
  416. -- 
  417. Donald Major       SAS Institute Inc.  "Cicely, let's fling something!"
  418. sasdtm@unx.sas.com SAS Campus Drive                 - Northern Exposure
  419. (919) 677-8000     Cary, NC 27513-2414
  420.  
  421.  
  422.  
  423. - -------------------------
  424.  
  425. From: wysocki@husc.harvard.edu (Chris Wysocki)
  426. Subject:  (A) Mixing PlaySnd and MacInTalk
  427. Date: 2 Mar 92 23:12:36 GMT
  428. Organization: Harvard University, Cambridge, MA
  429.  
  430. In article <1992Mar1.065333.26824@cs.brown.edu>, omh@cs.brown.edu (Owen M.
  431. Hartnett) writes:
  432.  
  433. > In article <kqspa0INNfaq@exodus.Eng.Sun.COM> gsager@heliacal.Eng.Sun.COM writes:
  434. > >I have a program that works fine doing just PlaySnd, or just MacInTalk, but if I
  435. > >mix the two, the program bombs (have to power off the machine!) apparently some-
  436. > >where in PlaySnd.  This is true even if it has been some time since the last call
  437. > >to MacInTalk, and if I have called SoundOff to shut off the MacInTalk driver.
  438. > >I have looked at all the related pointers and data at initialization and at call
  439. > >time, and nothing seems to be getting scrambled.
  440. > Try closing the sound driver, then opening it again, when you switch modes.
  441. > Use the CloseDriver, OpenDriver calls, Inside Mac II-178 or so.  Inside Mac
  442. > says you probably will never have to close the sound driver, but this time
  443. > you do!
  444. > Remember that Macintalk is using the old sound driver, not the new one, so
  445. > you'll have to use the old calls to close it.
  446.  
  447. Actually, MacinTalk doesn't use any of the OS sound routines; instead, it
  448. writes directly to the sound hardware addresses of the original Macintosh.
  449. The only reason that MacinTalk still works with more recent Mac models is
  450. that the Sound Manager goes into a so-called "compatibility mode" when it
  451. senses activity at the old sound hardware addresses.  The Sound Manager
  452. normally turns off "compatibility mode" only at _ExitToShell; however, if
  453. you reset the appropriate bit in register B of the VIA chip, you can reset
  454. "compatibility mode" yourself, thereby allowing you to combine MacinTalk 
  455. with Sound Manager calls.  The two necessary lines of assembly code are:
  456.  
  457.         MOVEA.L VIA,A0          ; get address of VIA register B
  458.         BSET    #vSndEnb,(A0)   ; turn off sound
  459.  
  460. After doing this, you should wait at least 60 ticks for the "sound sniffer"
  461. VBL task to notice the change; failure to do this will likely result in
  462. unpredictable system crashes.
  463.  
  464. Chris Wysocki
  465. wysocki@husc.harvard.edu
  466.  
  467.  
  468.  
  469. - -------------------------
  470.  
  471. From: mhkohne@jupiter.cs.umbc.edu (Michael Kohne)
  472. Subject:  (Q) Mixing PlaySnd and MacInTalk
  473. Organization: University of Maryland Baltimore Campus, Computer Science Department
  474. Date: Tue, 3 Mar 1992 01:55:02 GMT
  475.  
  476. In article <1992Mar2.193023.14784@unx.sas.com> sasdtm@stthomas.unx.sas.com (Donald T. Major) writes:
  477. >In article <kqspa0INNfaq@exodus.Eng.Sun.COM>, gsager@heliacal.Eng.Sun.COM (Gary Sager) writes:
  478. >|>
  479. >|> I have a program that works fine doing just PlaySnd, or just MacInTalk, but if I
  480. >|> mix the two, the program bombs (have to power off the machine!) apparently some-
  481. >|> where in PlaySnd.  This is true even if it has been some time since the last call
  482. >|> to MacInTalk, and if I have called SoundOff to shut off the MacInTalk driver.
  483. >|> I have looked at all the related pointers and data at initialization and at call
  484. >|> time, and nothing seems to be getting scrambled.
  485. >|>
  486. >|> This is on a IIsi.
  487. >|>
  488. >|> Does anyone have a clue why this might be happening (beyond the ever-possible
  489. >|> obscure bug I might have)?  I have heard that there is some problem with sound
  490. >|> on the IIsi, where sound gets disabled, but this seems much more extreme.
  491. >
  492. Ok, who has the source to MacinTalk?
  493.  
  494.  
  495.  
  496.  
  497. -- 
  498. "Pope" Q.E.D         Lord High Jabberwocky
  499. Michael Kohne        mhkohne@jupiter.cs.umbc.edu
  500. Coded Message: FIME NDUXXMS MZP FTQ EXUFTK FAHQE SKDQ MZP SUYNXQ UZ FTQ IMNQ.
  501.  
  502.  
  503.  
  504. - -------------------------
  505.  
  506. From: amanda@visix.com (Amanda Walker)
  507. Organization: Visix Software Inc., Reston, VA
  508. Date: Wed, 4 Mar 92 04:49:35 GMT
  509.  
  510. mhkohne@jupiter.cs.umbc.edu (Michael Kohne) writes:
  511. > Ok, who has the source to MacinTalk?
  512.  
  513. Nobody, not even Apple.  That is precisely the problem.
  514.  
  515. Amanda Walker                              amanda@visix.com
  516. Visix Software Inc.                    ...!uupsi!visix.com!amanda
  517. - -- 
  518. "You're making the same mistake that I did--assuming people are capable of
  519.  figuring out obvious behavior, when in practice they're not" --Eric Wiseblatt
  520.  
  521. ---------------------------
  522.  
  523. From: howard@rigel.cs.pdx.edu (howard l. berkey)
  524. Subject: Graf3D
  525. Date: 29 Feb 92 04:54:24 GMT
  526.  
  527.  
  528. Hi!
  529.     I just got the upgrade to THINK C 5.0.2 and noticed the library
  530. Graf3D.  I looked in the manual and couldn't find any info but by the header 
  531. it appears to be a full-featured 3D graphics library.  Is this true?  I haven't
  532. had time to try it yet... If you have any info about it, please e-mail it to
  533. me at:
  534.         howard@rigel.cs.pdx.edu
  535.     and I'll post any info given in a follow-up.
  536.  
  537. Thanks in advance!!!!
  538.     -Howard 
  539.  
  540.  
  541.  
  542. - -------------------------
  543.  
  544. From: howard@rigel.cs.pdx.edu (howard l. berkey)
  545. Date: 3 Mar 92 07:08:57 GMT
  546.  
  547. Thanks to all who responded to my questions about Graf3D!
  548. I've got about 20 pages of info now so instead of posting a follow-up,
  549. if you're interested, email me at this addr:
  550.     howard@rigel.cs.pdx.edu
  551. and I'll get back to you.
  552.  
  553.     -Howard
  554.  
  555. ---------------------------
  556.  
  557. From: ksh@vine.COM (Kent S. Harris)
  558. Subject: Prototyper v.3.0
  559. Date: 28 Feb 92 17:44:23 GMT
  560. Organization: Vine Technology, Cupertino, CA
  561.  
  562. Anyone have anything to say about Prototyper v.3.0 from Now Software, Inc.
  563. I need to design a fancy user interface for an application.
  564.  
  565. Thanks.
  566.  
  567.  
  568. -- 
  569. Kent S. Harris    ...!ames!vine!ksh    CONSULTING: Real-time system h/w & s/w,
  570. Vine Technology   (ksh@vine.com)          software development tools, project
  571. (408)996-1294     22 yr EE/CS exp.        analysis, information modeling.
  572.  
  573.  
  574.  
  575. - -------------------------
  576.  
  577. From: david@oahu.cs.ucla.edu (David Dantowitz)
  578. Subject:  Prototyper v.3.0
  579. Organization: UCLA Computer Science Department
  580. Date: Sat, 29 Feb 92 22:38:18 GMT
  581.  
  582. In article <3615@vine.COM> ksh@vine.COM (Kent S. Harris) writes:
  583. >Anyone have anything to say about Prototyper v.3.0 from Now Software, Inc.
  584. >I need to design a fancy user interface for an application.
  585.  
  586. I bought a copy and was a bit disapointed because it crashes quite
  587. easily.  It does however do okay every time you restart your machine
  588. or the app.  If you're just playing with menus and windows it's ok,
  589. but if you're trying to do anything fancy (and you can program an
  590. interface) you're better off writing your own C or Pascal, etc. code.
  591.  
  592. You may be better off with Appmaker (provided it doesn't crash very
  593. often).  Also, last year Prototyper's developer had a disagreement
  594. with Now Software.  I'm not sure where this lead, but I haven't seen
  595. an upgrade or any hint of one... They also covered up his picture on
  596. the box they sent me with a poorly glued on page.
  597.  
  598. How's that for someting to say?
  599.  
  600.  
  601.  
  602. -- 
  603. David Dantowitz
  604. david@cs.ucla.edu
  605.  
  606. Singing Barbershop when I'm not computing...
  607.  
  608.  
  609.  
  610. - -------------------------
  611.  
  612. From: tel@adimail.uucp (Terry Monks)
  613. Subject:  Prototyper v.3.0
  614. Date: 2 Mar 92 15:07:47 GMT
  615. Organization: Automata Design, Inc.
  616.  
  617. ksh@vine.COM (Kent S. Harris) writes:
  618. : Anyone have anything to say about Prototyper v.3.0 from Now Software, Inc.
  619. : I need to design a fancy user interface for an application.
  620.  
  621. I have been using it for years, ever since the first version and 
  622. really like it. Early versions of 3.0 seems to have had a crashing
  623. problem, but I have been using the latest heavily for a week now under
  624. System 7 and have had no crashes at all.
  625.  
  626. If you are using it with Think C 5, you will have to take care of
  627. a problem with include files that Symantec may have introduced in
  628. their latest changes. However, Symantec provides an application
  629. called "Propotyper Helper" that will process all your source files
  630. and take care of things quite nicely. Still it *is* an extra step.
  631.  
  632. Prototyper is very good at managing a changing prototype, i.e. one
  633. that you sketch out once, convert to code and run for a while, and
  634. then go back to make changes to the original prototype, but merge
  635. them with whatever *real* codes you have created in the meantime.
  636.  
  637.  
  638. : Thanks.
  639.  
  640. You welcome.
  641.  
  642. -- 
  643. Terry Monks        Automata Design Inc    (703) 472-9400
  644.  
  645.  
  646.  
  647. - -------------------------
  648.  
  649. Organization: Queen's University at Kingston
  650. Date: Monday, 2 Mar 1992 22:47:13 EST
  651. From: <CHARLESW@QUCDN.QueensU.CA>
  652.  
  653. Before you lay down your money for Prototyper take a look at AppMaker
  654. (Bowers Development 508/369-8175).  Both perform similar functions but
  655. differently.  I bought Prototyper some time ago, and later bought AppMaker.
  656. I was much happier with AppMaker (which didn't destroy my code changes and
  657. additions--I believe Prototyper now has a similar ability, but I haven't
  658. bothered to upgrade it).  I also prefered the AppMaker interface, but that's
  659. more a matter of personal preference.
  660.  
  661. .../dave   Dave Charlesworth
  662.  
  663. - -------------------------
  664.  
  665. From: jhl@naif.jpl.nasa.gov (Jay H. Lieske Sr)
  666. Organization: Jet Propulsion Laboratory
  667. Date: Tue, 3 Mar 92 20:38:36 GMT
  668.  
  669.     I have had Prototyper since version 1 first came out, and I faithfully
  670. 'upgraded' each time a new version was issued.  I was very dissatisfied with
  671. Version 3 and consider it a rather sloppy beta issue.  It won't even generate
  672. Pascal code that can successfully be compiled for any of the sample Pascal
  673. programs that are included with the program.  Now Software (SmethersBarnes)
  674. told me they'd send me an update when everything worked.  That was more than 16
  675. months ago and I haven't received anything from them.
  676.     I understand that the author of Prototyper (George Cossey) tried to have it
  677. withdrawn because it was not ready for distribution.  I believe that currently
  678. there's a law suit going on between the original author and Now Software.  The
  679. original author now produces an alternative product called Marksman.
  680.  
  681.  
  682. Jay H. Lieske Sr                                          
  683. jhl@naif.jpl.nasa.gov
  684.  
  685.  
  686. - -------------------------
  687.  
  688. From: haynes@mace.cc.purdue.edu (Carl W. Haynes III)
  689. Date: 3 Mar 92 23:10:37 GMT
  690. Organization: Purdue University Computing Center
  691.  
  692. In article <1992Mar3.203836.21277@elroy.jpl.nasa.gov> jhl@naif.jpl.nasa.gov (Jay H. Lieske Sr) writes:
  693. >
  694. >    I understand that the author of Prototyper (George Cossey) tried to have it
  695. >withdrawn because it was not ready for distribution.  I believe that currently
  696. >there's a law suit going on between the original author and Now Software.  The
  697. >original author now produces an alternative product called Marksman.
  698.  
  699. I received my copy of Marksman about a month ago, I had previously owned
  700. Prototyper 2.0 and 3.0. Here's my take on Marksman:
  701.  
  702. As other people have mentioned, Prototyper 3.0 was riddled with bugs,
  703. it really was like a real early beta copy. Marksman fixes most of the
  704. bugs and is usable, but it still feels like a beta release, there are
  705. many problems which are so obvious, it seems like it was not tested
  706. thoroughly before release.
  707.  
  708. Some of the problems I've had with it are: crashes when I select the pattern
  709. box in the 'hot spot' dialog; Many of the dialogs are too big to fit
  710. a 9" monitor (the Scroll box dialog for example). It allows you to drag 
  711. a window off the top the screen (no way to get it back). Again it feels
  712. like no one tested it on a compact Mac.
  713.  
  714. Although not a bug, my biggest peeve with Prototyper and now Marksman,
  715. is that it does not allow for creating multiple instances of windows.
  716.  
  717. Overall, Marksman is usable as long as you know what not to touch, unlike
  718. Prototyper which crashed whenever it felt like it. I used Prototyper
  719. and now Marksman for making up Mock-Ups of programs before I write
  720. the code, it is very useful when someone else has an idea for a 
  721. program, I can sit with them and design the interface. Marksman
  722. is a definite improvement over Prototyper for doing this.
  723.  
  724. I've never used AppMaker so I don't know how it compares.
  725.  
  726. carl
  727. haynes@mace.cc.purdue.edu
  728. AOL: CWH3
  729.  
  730. - -------------------------
  731.  
  732. From: dent@DIALix.oz.au (Andrew Dent)
  733. Organization: DIALix Services, Perth, Western Australia
  734. Date: Wed, 04 Mar 92 13:41:43 GMT
  735.  
  736. In <1992Feb29.223818.17534@cs.ucla.edu> david@oahu.cs.ucla.edu (David Dantowitz) writes:
  737.  
  738. >In article <3615@vine.COM> ksh@vine.COM (Kent S. Harris) writes:
  739. >>Anyone have anything to say about Prototyper v.3.0 from Now Software, Inc.
  740. >>I need to design a fancy user interface for an application.
  741.  
  742. >I bought a copy and was a bit disapointed because it crashes quite
  743. >easily.  It does however do okay every time you restart your machine
  744.  
  745. >You may be better off with Appmaker (provided it doesn't crash very
  746. >often).  Also, last year Prototyper's developer had a disagreement
  747. >with Now Software.  I'm not sure where this lead, but I haven't seen
  748.  
  749. The new product is called MarksMan and is pretty similar to Prototyper in
  750. operation. The rumour on CompuServer was that the disagreement came about
  751. because the developer (George Cossey) shipped a buggy beta to Now and 
  752. they went ahead and released it as Prototyper 3.
  753.  
  754. Marksman vs AppMaker is a matter of snazzy interface - Marksman is lots 
  755. easier to use, includes good colour support (including heaps of colour
  756. plug-in CDEFs etc.) and has all the Prototyper stuff such as menu control
  757. etc.
  758.  
  759. I've switched to AppMaker because I need code generated for the Think 
  760. Class Library and the MarksMan code generators don't follow the class
  761. library philosophy in a very OOP fashion (woeful DoCommand hierarchy
  762. support and no command numbers). However, I'm finding AppMaker LOTS
  763. harder to lay out my screens and it has virtually no colour support.
  764. Also, AppMaker lacks the "linking" facility that lets you generate code
  765. that automatically disables/enables things, swaps windows etc. This is
  766. not much of a hassle if you are using it with TCL as the class library 
  767. does much of this anyway.
  768.  
  769. Both products are well supported on Compu$serve.
  770.  
  771. Andy Dent
  772. A.D. Software - Mac, PC & Vax Programming and Training
  773. 94 Bermuda Dve, BALLAJURA  Western Australia  6066
  774. Phone/Fax: 09 249 2719 (local)  +619 249 2719 (International)
  775.        Internet: dent@DIALix.oz.au    Compuserve: 100033,3241
  776. "It's amazing what one can accomplish when one doesn't know 
  777.  what one can't do" (Garfield)
  778.  
  779.  
  780.  
  781. >-- 
  782. >David Dantowitz
  783. >david@cs.ucla.edu
  784.  
  785. >Singing Barbershop when I'm not computing...
  786.  
  787. ---------------------------
  788.  
  789. Organization: Freshman, MCS general, Carnegie Mellon, Pittsburgh, PA
  790. Date: Sat, 29 Feb 1992 03:44:19 -0500 
  791. From: Shawn James Cokus <sc5h+@andrew.cmu.edu>
  792. Subject: Zoom Rect. Code Needed
  793.  
  794.  
  795. Does anybody have some zoom rectangle (like that used in the Finder)
  796. code he/she would be willing to share?  Actually, the code isn't needed;
  797. a description of how to generate the successive rectangles making up
  798. each frame is all I require.  I have some ideas on how this is done, but
  799. I suspect that there is some standard method that is consistently used. 
  800. E-mail replies are fine.  Thanks in advance,
  801.  
  802. --Shawn.
  803.  
  804.  
  805. -- Shawn Cokus
  806. --   sc5h+@andrew.cmu.edu
  807. --   Carnegie-Mellon University, Pittsburgh, PA
  808. --   (Witty phrase temporarily out of order.)
  809.  
  810.  
  811.  
  812.  
  813. - -------------------------
  814.  
  815. From: lstein@athena.mit.edu (Lincoln Stein)
  816. Organization: Massachusetts Institute of Technology
  817. Date: Tue, 3 Mar 1992 12:28:50 GMT
  818.  
  819. >Does anybody have some zoom rectangle (like that used in the Finder)
  820. >code he/she would be willing to share?  Actually, the code isn't needed;
  821. >a description of how to generate the successive rectangles making up
  822. >each frame is all I require.  I have some ideas on how this is done, but
  823. >I suspect that there is some standard method that is consistently used.
  824. >E-mail replies are fine.  Thanks in advance,
  825.  
  826.  
  827. Here's how I did it in Pascal.  I haven't looked at this code for years,
  828. but I use it frequently:
  829.  
  830. unit Zoom;
  831.  
  832. interface
  833.  
  834. {ZoomRect is a procedure which zooms a series of dotted rectangles from}
  835. {startRect to endRect.  Pass it the rects in GLOBAL coordinates.}
  836.  
  837. procedure ZoomRect (startRect, EndRect: rect);
  838.  
  839. implementation
  840.  
  841. {-----------------------------------------------------------------------}
  842.   procedure ZoomRect (startRect, EndRect: rect);
  843.     const
  844.       NumRects = 4; {Number of rectangles displayed at once (the latency)}
  845.       Steps = 18;   {Coarseness of the grain}
  846.     var
  847.       TopStep, LeftStep, BottomStep, RightStep, i, j: integer;
  848.       EmptyRect: rect;
  849.       RectList: array[1..NumRects] of rect;
  850.       aPort, oldPort: Grafptr;
  851.       portStorage: GrafPort;
  852.   begin
  853.     TopStep := (EndRect.top - StartRect.top) div steps;
  854.     LeftStep := (EndRect.left - StartRect.left) div steps;
  855.     BottomStep := (EndRect.bottom - StartRect.bottom) div steps;
  856.     RightStep := (EndRect.right - StartRect.right) div steps;
  857.  
  858.     GetPort(oldPort); {save the current port}
  859.  
  860.     aPort := GrafPtr(@portStorage); {make aPort point to stack storage}
  861.  
  862. {open the port and make it current -- whole screen is used}
  863.     OpenPort(aPort); 
  864.     PenMode(notpatXor);
  865.     PenPat(gray);
  866.  
  867.     SetRect(EmptyRect, 0, 0, 0, 0);
  868.     for i := 1 to NumRects do
  869.       RectList[i] := EmptyRect;
  870.  
  871.     for i := 1 to steps - 1 do
  872.       begin
  873.         FrameRect(RectList[1]);   {erase first rect}
  874.         StartRect.top := StartRect.top + TopStep;
  875.         StartRect.left := StartRect.left + LeftStep;
  876.         StartRect.bottom := StartRect.bottom + BottomStep;
  877.         StartRect.right := StartRect.right + RightStep;
  878.         FrameRect(StartRect);   {paint next rect}
  879.         for j := 1 to NumRects - 1 do
  880.           RectList[j] := RectList[j + 1];
  881.         RectList[NumRects] := StartRect;  {remember last rect}
  882.       end;
  883.  
  884.     for i := 1 to NumRects do
  885.       FrameRect(RectList[i]);     {final erasure}
  886.  
  887.     ClosePort(aPort); {close the temporary port}
  888.  
  889.     SetPort(oldPort); {restore the previous port}
  890.   end;
  891. end.
  892.  
  893. ===============================================================================
  894. Lincoln D. Stein                                Brigham & Women's Hospital
  895. lstein@hstbme.mit.edu                           Boston, MA
  896. ===============================================================================
  897.  
  898. ---------------------------
  899.  
  900. From: yeongm2@aix.rpi.edu (Mengyik Yeong)
  901. Subject: Question on allocating memory for array??
  902. Date: Sat, 29 Feb 1992 22:05:42 GMT
  903.  
  904. I am trying to write a routine to allocate memory for an array which
  905. can have a variable number of elements.  I actually got this routine
  906. from A Book on C (Iforget the autho's name).  Could someone tell me why
  907. it does not work.  It is probably something silly which I didn't see.
  908. Here's the code:
  909.  
  910.     double **GetMatMem(short int n)
  911.     {
  912.         double **a;
  913.         short int i;
  914.  
  915.         a=(double **)calloc((unsigned long)n,              
  916.                     (unsigned long)sizeof(double *));
  917.         for (i=0;i<n;++i)
  918.             *(a+i)=(double *)calloc((unsigned long)n,
  919.                         (unsigned long)sizeof(double));
  920.     }
  921.  
  922. I am using Think C 5.0.  The program hangs in the for loop (Bus Error).
  923. Using the debugger it seems like the problem is with the *(a+i) expression,
  924. i.e. when I type *(a+i) into the debugger window it gives me **bus error**.
  925.  
  926. Any help would be greatly appreciated.
  927. Oh! I forgot, there is a return(a) after the for loop, but it never
  928. reaches that point.
  929.  
  930. Thanks
  931. Mengyik
  932. yeongm2@rpi.edu
  933.  
  934.  
  935.  
  936.  
  937. - -------------------------
  938.  
  939. From: ak237@cleveland.Freenet.Edu (Alan Toman)
  940. Organization: Case Western Reserve University, Cleveland, Ohio, (USA)
  941. Date: Tue, 3 Mar 92 13:36:26 GMT
  942.  
  943.  
  944. There is nothing wrong with the code, per se, however with THINK C 5.0
  945. #include <stdlib.h> must be included for calloc (an d malloc, etc) to
  946. work correclty.  Another option is to replace the calloc calls with
  947. NewPtrClear.
  948.  
  949. ---------------------------
  950.  
  951. From: bdw+@cs.cmu.edu (Blake Ward)
  952. Subject: Writing a WDEF that uses the default WDEF?
  953. Date: 1 Mar 92 18:03:21 GMT
  954. Organization: School of Computer Science, Carnegie Mellon
  955.  
  956.  
  957. I'd like to write a WDEF that adds an extra little icon (button) to the title
  958. bar (and detects clicks in it), but otherwise behaves extactly the same as
  959. the default system WDEF for documents.  Since I'd like to get all of the
  960. system's WDEF behavior for free (and be compatible with any future changes),
  961. I'd like to pass most of the messages like wCalcRgns, wGrow, etc. on to the
  962. default WDEF unchanged.  I could pass the wDraw message to the default WDEF
  963. and then also draw my own icon before returning.  Similarly, for the wHit
  964. message I could check first if the mouse went down in my icon and if not,
  965. just pass the message on to the default WDEF.
  966.  
  967. Is there anyone out there who has already done something like this and would
  968. be willing to give me some sample code?  If not, do any of you have any 
  969. suggestions, caveats, etc.?  Thanks in advance.
  970.  
  971.  
  972.  
  973. - -------------------------
  974.  
  975. From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
  976. Date: Tue, 03 Mar 1992 00:35:20 -0500
  977.  
  978.  BW> From: bdw+@cs.cmu.edu (Blake Ward)
  979.  
  980.  BW> I'd like to write a WDEF that adds an extra little icon (button) to the
  981.  BW> title bar (and detects clicks in it), but otherwise behaves extactly
  982.  BW> the same as the default system WDEF for documents. Since I'd like to
  983.  BW> get all of the system's WDEF behavior for free (and be compatible with
  984.  BW> any future changes), I'd like to pass most of the messages like
  985.  BW> wCalcRgns, wGrow, etc. on to the default WDEF unchanged.
  986.  
  987. Wait, this is a test, right? You're a _d e v e l o p_ editor in disguise
  988. trying to see if anyone's paying attention, right?
  989.  
  990. Try this month's _d e v e l o p_, available on a CD near you (or through
  991. snail mail), in which this topic is specifically addressed.
  992.  
  993. ---------------------------
  994.  
  995. From: kempkec@fog.CS.ORST.EDU (Christopher Kempke)
  996. Subject: Random Numbers (Toolbox Built-in)
  997. Date: 2 Mar 92 08:12:53 GMT
  998. Organization: Oregon State University, Computer Science Dept.
  999.  
  1000.  
  1001.     Hope this isn't a FAQ, I've just resumed reading after a long
  1002.     absence.  I've got a couple questions for any knowledgable types
  1003.     out there.
  1004.  
  1005.     Regarding the builtin Random() function:
  1006.  
  1007.     For a given RandSeed, will this function return the SAME sequence
  1008.     of numbers over all Macintosh models?
  1009.  
  1010.     Is this function's implementation likely/unlikely/inconceiveably (sp!)
  1011.     going to change in the future, or can I rely on always getting the
  1012.     same sequence for a given seed?
  1013.  
  1014.     What is the algorithm itself, unless it's proprietary?
  1015.     (This last question is only really necessary if I can't rely
  1016.     on the builtin function to remain constant.)
  1017.  
  1018.     I'm doing "fractal" (actually midpoint subdivision) to generate
  1019.     some (fictitious) terrain maps I'll need to reproduce, and never
  1020.     considered until now that my randomization might be built on
  1021.     shaky ground.  Thanks for any help you can give,
  1022.  
  1023.         Chris
  1024.  
  1025.  
  1026.  
  1027. - -------------------------
  1028.  
  1029. From: fry@tara.harvard.edu (David Fry)
  1030. Subject:  Random Numbers (Toolbox Built-in)
  1031. Date: 2 Mar 92 13:00:14 GMT
  1032. Organization: Harvard Math Department
  1033.  
  1034.  
  1035. Random() is based on the following algorithm.  The only
  1036. difference is that this code uses all 32-bits for a random
  1037. number generator with 2^31-1 period, but Random() returns the
  1038. low two bytes for a 16-bit number.  You can avoid this by
  1039. calling Random() but then using the value in randSeed as your
  1040. random number.
  1041.  
  1042. Or if you're afraid of the algorithm changing in the future 
  1043. (which I think is quite likely), use the following code.  
  1044. For now it will give identical numbers.  See the article
  1045. mentioned in the comments below for reasons why this is a good
  1046. algorithm.
  1047.  
  1048. David Fry                               fry@math.harvard.EDU
  1049. Department of Mathematics               fry@huma1.bitnet
  1050. Harvard University                      ...!harvard!huma1!fry
  1051. Cambridge, MA  02138            
  1052.  
  1053. static    long    acm_randseed;
  1054.  
  1055. #define        ACM_MAX        2147483647
  1056.  
  1057. set_acm_seed(seed)
  1058. long    seed;
  1059. /*
  1060. *    Set the seed for the minimal standard random number generator.
  1061. */
  1062. {
  1063.     if ( seed == 0 )
  1064.         seed = 1;
  1065.     if ( seed < 0 )
  1066.         seed = -seed;
  1067.     acm_randseed = seed;
  1068. }
  1069.  
  1070.  
  1071. long acm_random()
  1072. /*
  1073. *    This implements the "minimal standard random number generator"
  1074. *    as proposed by Park and Miller in CACM October, 1988.
  1075. *    It has a period of 2147483647.
  1076. */
  1077. {
  1078.     long    lo, hi, test;
  1079.     
  1080.     hi = acm_randseed / 127773;
  1081.     lo = acm_randseed % 127773;
  1082.     test = 16807 * lo - 2836 * hi;
  1083.     if ( test > 0 )
  1084.         acm_randseed = test;
  1085.     else
  1086.         acm_randseed = test + ACM_MAX;
  1087.     return(acm_randseed);    
  1088. }
  1089.  
  1090.  
  1091.  
  1092. - -------------------------
  1093.  
  1094. From: jmatthews@desire.wright.edu
  1095. Date: 4 Mar 92 00:17:49 EST
  1096. Organization: Wright State University 
  1097.  
  1098. In article <1992Mar2.080016.9381@husc3.harvard.edu>, fry@tara.harvard.edu (David Fry) writes:
  1099. > Random() is based on the following algorithm.
  1100. [exemplary C code deleted]
  1101.  
  1102. And now for something virtually identical:
  1103.  
  1104. unit ACMRandom;
  1105.  
  1106. interface
  1107.  
  1108.   procedure SetACMSeed (seed: LongInt);
  1109.   function ACMRandom: LongInt;
  1110.  
  1111. implementation
  1112.  
  1113.   var
  1114.     acmRandSeed: LongInt; {static variable}
  1115.  
  1116.   procedure SetACMSeed (seed: LongInt);
  1117.   begin
  1118.     if seed = 0 then seed := 1;
  1119.     if seed < 0 then seed := -seed;
  1120.     acmRandSeed := seed;
  1121.   end;
  1122.  
  1123.   function ACMRandom: LongInt;
  1124.   {"minimal standard random number generator" proposed by}
  1125.   {Parker & Miller in CACM, 1988; it has period (2^31)-1}
  1126.     var
  1127.       lo, hi, test: LongInt;
  1128.   begin
  1129.     hi := acmRandSeed div 127773;
  1130.     lo := acmRandSeed mod 127773;
  1131.     test := 16807 * lo - 2836 * hi;
  1132.     if test > 0 then acmRandSeed := test
  1133.     else acmRandSeed := test + maxLongInt;
  1134.     ACMRandom := acmRandSeed;
  1135.   end;
  1136.  
  1137. end.
  1138.  
  1139. o----------------------------------------------------------------------------o
  1140. | John B. Matthews, jmatthews@desire.wright.edu, disclaimer:= myViews <> WSU |
  1141. | "I'm a commensal .sig virus, indistinguishable from an ordinary organelle."|
  1142. o----------------------------------------------------------------------------o
  1143.  
  1144.  
  1145. ---------------------------
  1146.  
  1147. End of C.S.M.P. Digest
  1148. **********************
  1149.